package com.jsm.tf.director;

import com.jsm.tf.TfClientApplication;
import com.jsm.tf.entity.User;
import com.jsm.tf.room.RoomDTO;
import de.felixroske.jfxsupport.AbstractFxmlView;
import io.netty.channel.Channel;
import javafx.application.Platform;
import lombok.Data;
import org.springframework.stereotype.Component;


@Component
@Data
public class Director {
    public User user = null;
    public Channel channel;
    private RoomDTO room;
    private int page = 0;
    private int pageSize = 10;

    public void showView(Class<? extends AbstractFxmlView> viewClass) {
        Platform.runLater(() -> TfClientApplication.showView(viewClass));
    }

    public int nextPage() {
        page++;
        return page;
    }

    public int previousPage() {
        page--;
        return page;
    }
}
